{extend name="../../public/admin"}
{block name="title"}数据字典{/block}
{block name="css"}
<link rel="stylesheet" href="__PUBLIC__/admin/css/index.dictionaries.css">
{/block}
{block name="body"}
<div id="container">


    <div class="clearfix"></div>
    <div style="height: 20px;"></div>
    <div class="table-responsive" id="header">
        <table class="table table-bordered table-hover" v-cloak>
            <thead>
            <tr class="active text-left">
                <th colspan="13">
                    <a href="javascript:;" @click="addData()" class="btn btn-info btn-sm"><i class="fa fa-plus"></i>
                        {:lang('添加')}</a>
                    <span class="fa-pull-right">总 <strong>{{list.length}}</strong> 条</span>
                </th>
            </tr>
            <tr class="active">
                <th>{:lang('序号')}</th>
                <th>{:lang('描述')}</th>
                <th>{:lang('图片')}</th>
                <th>{:lang('时间')}</th>
            </tr>
            </thead>
            <tbody>
            <template v-for="(key,index) in list">
                <tr>
                    <th>{{index+1}}</th>
                    <th>{{key.text}}</th>
                    <th><a href="javascript:;" @click="imgLock(key.img)">{:lang('查看')}</a></th>
                    <th>{{key.time}}</th>
                </tr>
            </template>
            </tbody>
        </table>
    </div>
    <div id="Pagination"></div>

</div>
{/block}
{block name="js"}


<script>
    var app = new Vue({
        el: '#container',
        data: {
            list: []
        }
    });

    get_data();

    //获取数据
    function get_data() {
        layer.load(1);
        $.get("{:url('count/complete',['id'=>$Request.param.id])}", function (da) {
            app.list = da;
            layer.closeAll();
        });
    }

    //查看图片
    app.imgLock = (url)=>{
        layer.open({
            type:2,
            title:'查看文件',
            shift:'3',
            area:['100%','100%'],
            content:url
        })
    }





    //添加内容
    app.addData = () => {
        layer.open({
            type:2,
            area:['500px','400px'],
            content:"{:url('count/addd',['id'=>$Request.param.id])}"
        })
    }
</script>
{/block}